Database replication, or data replication, is a technique for keeping data synchronized across multiple databases. For example, one may want to replicate a database for backup purposes, or maintain different copies of a database at different locations. In either type of scenario, the goal is to have the same data operations performed on all copies of the database. One approach enables flexible data replication by providing a data stream that can be subscribed to by other databases. Changes to data in a source database are logged as events and sent over the stream. This approach tolerates some differences in the databases and, therefore, is effectively a logical copy process rather than a physical copy process. One such approach to data replication among multiple databases is described in U.S. Pat. No. 6,889,231 to Souder et al., entitled “Asynchronous Information Sharing System” (“the Souder patent”), the entire content of which is incorporated by reference in its entirety for all purposes as if fully disclosed herein.
Since an RDBMS may support storage and management of XML data, there is a need to replicate XML data among multiple databases. However, there are many challenges with replicating XML data in a cost-efficient manner. Replicating XML data can be expensive because XML data can be very verbose because, unlike relational data, XML data contains repetitious tags. This is especially problematic for replicating update operations, where only a small portion of the XML document may have changed via a given update operation. Further, an RDBMS may “shred” the XML data into object-relational (“OR”) and/or relational data constructs. However, replicating complete XML data would not leverage existing OR replication functionality.
Additionally, the XQuery Data Model can be used to represent the result of an XQuery or XPath expression, represented as an ordered sequence of arbitrary items of corresponding data types. A sequence may contain nodes, atomic values, or any mixture of nodes and atomic values. The XQuery Data Model is described in “XQuery 1.0 and XPath 2.0 Data Model (XDM)” available as a W3C Recommendation from the W3C organization, the entire content of which is incorporated by reference in its entirety for all purposes as if fully disclosed herein. SQL/XML allows XMLType data stored in a database to be either (a) XML (Document), e.g., an XML 1.0 document; or (b) XML (Content), e.g., an XML fragment; or (c) XML (Sequence), e.g., the result of an XQuery data model sequence. Thus, with the introduction of XQuery and the XQuery Data Model and the concept of XML (Sequence) XML data type in the database system, XQuery Data Model sequences should also be supported for replication.
Hence, based on the foregoing, there is a need for techniques for efficiently replicating XML data.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.